Skip to content

Commit

Permalink
snapshot of project "lynx", label v2-9-0dev_10c
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasDickey committed Mar 12, 2022
1 parent 7875531 commit 3f9967c
Show file tree
Hide file tree
Showing 8 changed files with 890 additions and 55 deletions.
8 changes: 6 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
-- $LynxId: CHANGES,v 1.1101 2022/03/11 01:29:33 tom Exp $
-- $LynxId: CHANGES,v 1.1104 2022/03/12 16:16:34 tom Exp $
===============================================================================
Changes since Lynx 2.8 release
===============================================================================

2022-03-10 (2.9.0dev.11)
2022-03-12 (2.9.0dev.11)
* changes for working with SOCKS5 on Windows 10 -GV, -TD
* fix a few coverity and clang warnings -TD
* add a null-pointer check in StrAllocVsprintf() to work with existing SOCKS5
configuration (report/patch by Gisle Vanem).
* change capitalization of "Content-type" sent to the remote server to work
around "HeavyThing" server which does not follow RFC 2616 in treating field
name as case insensitive (report/patch by Sylvain Bertrand)
Expand Down
4 changes: 2 additions & 2 deletions WWW/Library/Implementation/HTFTP.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $LynxId: HTFTP.c,v 1.142 2020/02/26 23:40:14 tom Exp $
* $LynxId: HTFTP.c,v 1.143 2022/03/12 12:06:13 tom Exp $
*
* File Transfer Protocol (FTP) Client
* for a WorldWideWeb browser
Expand Down Expand Up @@ -1175,12 +1175,12 @@ static int get_listen_socket(void)

#ifdef INET6
/* query address family of control connection */
memset(&soc_A, 0, sizeof(soc_A));
slen = (LY_SOCKLEN) sizeof(soc_A);
if (getsockname(control->socket, SOCKADDR_OF(soc_A), &slen) < 0) {
return HTInetStatus("getsockname failed");
}
af = SOCKADDR_OF(soc_A)->sa_family;
memset(&soc_A, 0, sizeof(soc_A));
#endif /* INET6 */

/* Create internet socket
Expand Down
6 changes: 2 additions & 4 deletions WWW/Library/Implementation/HTFormat.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $LynxId: HTFormat.c,v 1.91 2019/01/02 23:25:10 tom Exp $
* $LynxId: HTFormat.c,v 1.92 2022/03/12 14:40:38 tom Exp $
*
* Manage different file formats HTFormat.c
* =============================
Expand Down Expand Up @@ -1183,9 +1183,7 @@ static int HTZzFileCopy(FILE *zzfp, HTStream *sink)
*/
targetClass = *(sink->isa); /* Copy pointers to procedures */

s.zalloc = Z_NULL;
s.zfree = Z_NULL;
s.opaque = Z_NULL;
memset(&s, 0, sizeof(s));
status = inflateInit(&s);
if (status != Z_OK) {
CTRACE((tfp, "HTZzFileCopy inflateInit() %s\n", zError(status)));
Expand Down
4 changes: 2 additions & 2 deletions WWW/Library/Implementation/HTMIME.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $LynxId: HTMIME.c,v 1.101 2021/06/29 22:01:12 tom Exp $
* $LynxId: HTMIME.c,v 1.102 2022/03/12 14:47:02 tom Exp $
*
* MIME Message Parse HTMIME.c
* ==================
Expand Down Expand Up @@ -2394,7 +2394,7 @@ void HTmmdecode(char **target,
if ((buf = typeMallocn(char, strlen(source) + 1)) == 0)
outofmem(__FILE__, "HTmmdecode");

for (s = source, u = buf; *s;) {
for (s = source, *(u = buf) = '\0'; *s;) {
if (!strncasecomp(s, "=?ISO-2022-JP?B?", 16)) {
base64 = 1;
} else {
Expand Down
4 changes: 2 additions & 2 deletions WWW/Library/Implementation/HTNews.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $LynxId: HTNews.c,v 1.78 2021/06/09 19:29:36 tom Exp $
* $LynxId: HTNews.c,v 1.79 2022/03/12 15:45:16 tom Exp $
*
* NEWS ACCESS HTNews.c
* ===========
Expand Down Expand Up @@ -1609,7 +1609,7 @@ static int read_list(char *arg)
PUTS("Newsgroups");
END(HTML_H1);
PUTC('\n');
p = line;
*(p = line) = '\0';
START(HTML_DLC);
PUTC('\n');
while (!done) {
Expand Down
4 changes: 2 additions & 2 deletions WWW/Library/Implementation/HTString.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $LynxId: HTString.c,v 1.81 2021/06/09 20:16:06 tom Exp $
* $LynxId: HTString.c,v 1.82 2022/03/12 12:19:10 Gisle.Vanem Exp $
*
* Case-independent string comparison HTString.c
*
Expand Down Expand Up @@ -677,7 +677,7 @@ PUBLIC_IF_FIND_LEAKS char *StrAllocVsprintf(char **pstr,
char *fmt_ptr;
#endif /* SAVE_TIME_NOT_SPACE */
size_t have, need;
char *dst_ptr = *pstr;
char *dst_ptr = pstr ? *pstr : NULL;
const char *format = fmt;

if (isEmpty(fmt))
Expand Down
18 changes: 10 additions & 8 deletions WWW/Library/Implementation/HTTCP.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $LynxId: HTTCP.c,v 1.160 2021/06/08 23:44:43 tom Exp $
* $LynxId: HTTCP.c,v 1.162 2022/03/12 16:45:47 tom Exp $
*
* Generic Communication Code HTTCP.c
* ==========================
Expand Down Expand Up @@ -1888,9 +1888,9 @@ int HTDoConnect(const char *url,
HTSACat(&socks5_new_url, socks5_proxy);
url = socks5_new_url;

socks5_protocol = HTSprintf0(NULL,
gettext("(for %s at %s) SOCKS5"),
protocol, socks5_host);
HTSprintf0(&socks5_protocol,
gettext("(for %s at %s) SOCKS5"),
protocol, socks5_host);
protocol = socks5_protocol;
}
#ifndef INET6
Expand Down Expand Up @@ -2032,6 +2032,8 @@ int HTDoConnect(const char *url,
* write service procedure. This will be
* the normal case.
*/
CTRACE((tfp, "connect(): status: %d, SOCK_ERRNO: %d\n", status, SOCKET_ERRNO));

if ((status < 0) &&
(SOCKET_ERRNO == EINPROGRESS
#ifdef EAGAIN
Expand Down Expand Up @@ -2091,7 +2093,7 @@ int HTDoConnect(const char *url,
* If we suspend, then it is possible that select will be
* interrupted. Allow for this possibility. - JED
*/
if ((ret == -1) && (errno == EINTR))
if ((ret == -1) && (SOCKET_ERRNO == EINTR))
continue;

#ifdef SOCKET_DEBUG_TRACE
Expand Down Expand Up @@ -2273,7 +2275,7 @@ int HTDoConnect(const char *url,
pbuf[0] = 0x05; /* VER: protocol version: X'05' */
pbuf[1] = 0x01; /* NMETHODS: 1 */
pbuf[2] = 0x00; /* METHOD: X'00' NO AUTHENTICATION REQUIRED */
if (write(*s, pbuf, 3) != 3) {
if (NETWRITE(*s, (char *) pbuf, 3) != 3) {
goto report_system_err;
} else if (HTDoRead(*s, pbuf, 2) != 2) {
goto report_system_err;
Expand All @@ -2298,7 +2300,7 @@ int HTDoConnect(const char *url,
memcpy(&pbuf[i], (unsigned char *) &x, sizeof x);
i += (unsigned) sizeof(x);
}
if ((size_t) write(*s, pbuf, i) != i) {
if ((size_t) NETWRITE(*s, (char *) pbuf, i) != i) {
goto report_system_err;
} else if ((unsigned) HTDoRead(*s, pbuf, 4) != 4) {
goto report_system_err;
Expand Down Expand Up @@ -2534,7 +2536,7 @@ int HTDoRead(int fildes,
break;
}
#else /* UNIX */
result = SOCKET_READ(fildes, buf, nbyte);
result = NETREAD(fildes, (char *) buf, nbyte);
#endif /* !UNIX */
#endif /* UCX && VAXC */
}
Expand Down

0 comments on commit 3f9967c

Please sign in to comment.